package com.bjpowernode.test01;

public class Account {
    String name;
    int id;
    double balance;
    double annalualInteRate;

    public Account(){}
    public Account(String name,int id,double balance,double annalualInteRate){
        this.name=name;
        this.id=id;
        this.balance=balance;
        this.annalualInteRate=annalualInteRate;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public double getAnnalualInteRate() {
        return annalualInteRate;
    }

    public void setAnnalualInteRate(double annalualInteRate) {
        this.annalualInteRate = annalualInteRate;
    }

    //定义取款方法
    public double withDraw(double balance,double num){
        System.out.println("成功取款"+num+"元");
        balance = balance-num;
        return balance;
    }

    //定义存款方法
    public double deposit(double balance,double num){
        System.out.println("成功存款"+num+"元");
        balance = balance+num;
        return balance;
    }
}
